package com.changzhi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.changzhi.ldyl.model.UserWallet;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huangrc
 * @since 2020-12-24
 */
public interface UserWalletMapper extends BaseMapper<UserWallet> {

	UserWallet selectByUserId(@Param("userId") String userId);

	int reduceDiamondsAmount(@Param("id") Integer id, @Param("value") Integer value);

	int addDiamondsAmount(@Param("id") Integer id, @Param("value") Integer value);

	int updateCrystalAmount(@Param("userId") String userId,
							@Param("paidAmount") Integer paidAmount,
							@Param("totalIncomeDecimal") BigDecimal totalIncomeDecimal,
							@Param("familyChannelCrystal") Integer familyChannelCrystal,
							@Param("familyChannelCrystalDecimal") BigDecimal familyChannelCrystalDecimal);
}
